<template>
  <div class="loading_container" v-show="visible">
    <div class="loading_wrapper">
      <div class="loading_content">
        <div class="loading_content_img">
          <img src="../../assets/loading.gif" alt="" />
        </div>
        <div class="loading_content_text">loading...</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
    };
  },
  mounted() {
    this.visible = true;
  },
  methods: {
    close() {
      setTimeout(() => {
        this.visible = false;
      }, 2000);
    },
  },
};
</script>

<style lang="scss" scoped>
.loading_container {
  width: 100vw;
  height: 100vh;
  background-color: rgb(5, 5, 5);
  opacity: 0.7;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 999999999;
  .loading_wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    .loading_content {
      width: 50%;
      .loading_content_img {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        img {
          width: 100%;
        }
      }
      .loading_content_text {
        width: 100%;
        font-size: 20px;
        color: #f5f5f5;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
    }
  }
}
</style>